<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<?php
/*
 * Script que preenche a tabela dos utilizadores convidados
 */

if(!isset($_SESSION['projectID'])){
	session_start();
}

require_once '../../../serverResources/includes/classes/Affiliation.php';
require_once '../../../serverResources/includes/db/ConnDBUser.php';
require_once '../../../serverResources/includes/classes/Group.php';

?>


<table class="normalTable">
			<thead>
				<tr><th colspan="2">Listagem de grupos</th></tr>
			</thead>
		
			<tbody>
			
				<?php
		$group=new Group('', '');
		$groupNames=$group->showGroups($_SESSION['projectID']);
		//print_r($groupNames);
		$count_=0;
		for($i=0; $i<count($groupNames); $i++){
			
			if(isset($groupNames[$i])){
				$count_++;
			?>
		<tr <?php if ($count_ % 2 == 0){echo "class='odd'"; }else{echo "class='even'";}  ?>>
			<td><?php echo $groupNames[$i]['groupName']?> </td>
			<td width="50">
			
			<!-- btn delete --> 
			<a id="deleteGroup<?php echo $i ?>" class="btn_delete"
				onclick="deleteGroup(<?php echo $groupNames[$i]['groupID']?>);"
				title="Eliminar Grupo" href="#"></a> 
			<script type="text/javascript">
			// tooltips
			  $(function() {
			    $('#deleteGroup<?php echo $i; ?>').tipsy({gravity: $.fn.tipsy.autoNS, fade: true });
			  });
			</script> <!-- btn edit --> 
			<a id="editGroup<?php echo $i; ?>" class="btn_edit"
				onclick="editGroupInfo(<?php echo $groupNames[$i]['groupID']?>, '<?php echo $groupNames[$i]['groupName'] ?>');"
				title="Editar Grupo" href="#"></a> 
			<script type="text/javascript">
			// tooltips
			  $(function() {
			    $('#editGroup<?php echo $i; ?>').tipsy({gravity: $.fn.tipsy.autoNS, fade: true });
			  });
			</script>
			
		</tr>
			<?php
			}
		}
		?>		
			</tbody>
		
		</table>